<script>
  import $ from 'dfish-widget'
  import Method from '../Method.vue'

  export default {
    mixins: [Method],
    data() {
      return {
        name: '$.scrollIntoView(target, [option])',
        remark: '滚动到可视范围。',
        attrs: [{
          name: 'target',
          remark: 'Widget组件或DOM节点',
          type: 'Widget | HTMLElement',
        }, {
          name: 'option',
          remark: 'Widget组件或DOM节点',
          type: 'Object',
          attrs: [{
              name: 'ease',
              remark: '滚动动画效果的时长，单位毫秒',
              type: 'Number',
            },{
              name: 'success',
              remark: '滚动结束后调用的方法',
              type: 'Funtion',
            },
          ]  
        }],
        examples: [{
          remark: '使一个DOM对象滚动到可视范围。',
          code: `
            let tar = document.getElementById('obj');
            $.scrollIntoView(tar);
            `
        }]
      }
    }
  }
</script>
